import AuthenticationSelect from "@/components/AuthenticationSelect"
import BelongSelect from "@/components/BelongSelect"
import { AntdModalProps } from "@/hooks/useAntdModal"
import { saveProject } from "@/service/deliver"
import { Button, Form, Input, Modal, Radio, Select, Space } from "antd"

const SaveProject = ({ form, closeModal, refresh, modalProps }: AntdModalProps) => {
  const onOk = async () => {
    let data = await form.validateFields()

    await saveProject(data)
    refresh()
    closeModal()
  }
  return <Modal  {...modalProps} onOk={onOk}>
    <Form labelCol={{ span: 4 }} form={form} initialValues={{
      type: 'codeup'
    }}>
      <Form.Item hidden name='id'>
        <Input />
      </Form.Item>
      <Form.Item label="项目名称" name='name' rules={[{
        required: true,
        message: '项目名称'
      }]}>
        <Input />
      </Form.Item>
      <Form.Item name='belong' label='项目归属'>
        <BelongSelect/> 
      </Form.Item>
      <Form.Item label="图片" name='img' rules={[{
        required: true,
        message: '图片'
      }]}>
        <Input />
      </Form.Item>


    </Form>
  </Modal>
}
export default SaveProject